<%--
 *  File:    userinfo.jsp
 *  @Author: Langerwang 
 *  Date:    2001/12/10
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>
<%
  //init param
  	Category cat = Category.getInstance("jsp.UserEdit");    
  	cat.debug("into jsp!");
	String strModuleName = "UPM";
	String privilegeCode = "Z0102,L401";
    String contextPath = request.getContextPath();
%>



<%
%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>

<html>
<head>
<title></title>
<PageFlow:CheckPageFlow pageName="userinfo"/>
<%@ include file="/inc/InitEdit.inc" %>

<%
  HashMap userinformation = (HashMap)pageContext.getAttribute("userinfo");
  if(userinformation == null)
  {
	  userinformation = new HashMap();
  }   
  
  HashMap homeaddress = (HashMap)pageContext.getAttribute("homeaddress");
  if(homeaddress == null)
  {
	  homeaddress = new HashMap();
  }  
  
  String isusesystem = "N";
  
  isusesystem = (String)userinformation.get("isusesystem") == null ? "N" : "Y";
  boolean haspassword = isusesystem.equals("Y");
  
  String strIsCanUpdatePassword  = "";
  
  Object canupdatepassword = userinformation.get("canupdatepassword");
 
     if(canupdatepassword != null){
    	 strIsCanUpdatePassword = "checked";
    	 
     }
     
     String issalesman = "N";
     
     issalesman = (String)userinformation.get("issalesman");
     if(issalesman == null && issalesman == ""){
    	 issalesman="N";
     }
     
  Object password = userinformation.get("password");
  String flag = "";
  if(password != null){
	  flag = "has";
  }
  System.out.println("password:   " + password + "  f lag;: " + flag);
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../js/FuncLib.js"></script>
<script language="JavaScript/text" src="../../js/ScriptLib.js"></script>
<%@ include file="/inc/NewCalendar.inc" %>
<%
    HashMap userinfo=(HashMap)session.getAttribute("userinfo");
    Integer booksetid=null,neworgid=null;
    if(userinfo!=null)
    booksetid=(Integer)userinfo.get("booksetid");
    neworgid=(Integer)userinfo.get("orgid");

%>
<script language="JavaScript">
var needcheckaddress = false;
var popwindow;
function showPassword(){
	var flag = '<%=flag%>';
	if(flag){
		var table = document.getElementById('passwordtable');
		table.style.display = 'block';	
	}
	
}

function popWindowsContactProd(){

	var userid = frm.userid.value;
	
	if(!document.getElementById("issalesman").checked)
	{
		//alert("非业务人员不允许添加产品");
		alert("<%=message.getMessageDesc("Not_Allowed_To_Add_Non-business")%>");
		return;
	}

	var url = 'contactProdPopWindow.jsp?'+'<%= OvalTools.randomURL() %>'+'&usrid='+userid+'&isbottom=1&isview=1';

	var windowAttribute = "height=400, width=600,top=100,left=100, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=yes";
	if(popwindow!=null) popwindow.close();
 	popwindow = window.open(url,null,windowAttribute);
 	
 	
}

 function popWindowsContactRelation(){
	var issalesmanflag = frm.issalesman;
	var userid = frm.userid.value;
	if (!document.getElementById("issalesman").checked){
		var url = "ContactRelationPopWindow.jsp?"+"<%= OvalTools.randomURL() %>"+"&usrid="+userid+'&isview=1';
		var windowAttribute = "height=400, width=600,top=100,left=100, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=yes";
		if(popwindow!=null) popwindow.close();
	 	popwindow = window.open(url,null,windowAttribute);
	}else{
		alert("<%=message.getMessageDesc("Maintenance_Only_Non-business")%>");
	}
}

function onload(){
  //document.frm.issalesman
    <%
    if("Y".equals(isusesystem)){
   %>
    	//document.frm.issalesman.checked=true;
    	//document.frm.issalesman.checked=true;
    	document.getElementById("isusesystem").checked=true;
   <%
    }
  %>
  <%
    if("Y".equals(issalesman)){
   %>
    	//document.frm.issalesman.checked=true;
    	//document.frm.issalesman.checked=true;
    	document.getElementById("issalesman").checked=true;
   <%
    }
  %>
}
</script>
<iframe name="reloadHandler" style="display:none" ></iframe>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="onload();">
<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td class="summary_top"></td>
  </tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0">
  <form name="frm" method="post" action="../../Dispatcher">
       <input type=hidden name=numrows value='<%= ConstantProp.multiLangNumber %>'>

	   <input type="hidden" name="pagename" value="userinfo">
       <input type="hidden" name="actionname">
       <input type="hidden" name="userid" value="<%=JspHelper.filterNull( userinformation.get("userid") )%>" >
       <input type="hidden" name="languagecode" value="<%= strLanguageCode %>">
     
  <tr>
    <td valign="top">
        <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="3">
          <tr>
            <td colspan="4" class="deepblue-left"> <img src="../../images/<%= strLanguageCode %>/quote.gif">
              <%= label.getLabelName("L_BasicInfo") + label.getLabelName("L_Colon") %> </td>
          </tr>
          <tr>
            <td width="106" class="td-text"><%= label.getLabelName("L_UserCode") + label.getLabelName("L_Colon") %> </td>
            <td width="">
            	&nbsp;<oval:write name="userinfo" property="username"/>
            </td>
            <td class="td-text" width="106" ><%= label.getLabelName("L_DefaultDeptName") + label.getLabelName("L_Colon") %> </td>
            <td width="228" >
            	&nbsp;<oval:write name="userinfo" property="deptname"/>
            </td>
          </tr>
          <tr>
            <td width="106" class="td-text"><%= label.getLabelName("L_EmployeeCode1") + label.getLabelName("L_Colon") %> </td>
            <td > 
            	&nbsp;<oval:write name="userinfo" property="employeecode"/>
            </td>
            <td width="106" class="td-text"> <%= label.getLabelName("L_UUserName") + label.getLabelName("L_Colon") %></td>
            <td width="228" > 
              &nbsp;<oval:write name="userinfo" property="employeename"/>
              &nbsp;<!--<oval:write name="userinfo" property="lastname"/>-->
            </td>
          </tr>
          <tr> 
            <td class="td-text" width="106"><%= label.getLabelName("L_GenderName") + label.getLabelName("L_Colon") %></td>
            <td > 
            	 &nbsp;<!--<oval:write name="userinfo" property="gendername"/>-->
            	 <custom:selectdic name="userinfo" property="gender"
					dictType="Gender" 
					disabled="true" />
            </td>
            <td class="td-text" width="106" ><%= label.getLabelName("L_TitleName") + label.getLabelName("L_Colon") %></td>
            <td width="228" > 
            	&nbsp;<oval:write name="userinfo" property="valuename"/>
            </td>
          </tr>
          <tr> 
            <td class="td-text" width="106"><%= label.getLabelName("L_EducationalLevel") + label.getLabelName("L_Colon") %></td>
            <td > 
            	&nbsp;<!--<oval:write name="userinfo" property="educationlevelname"/>-->
            	<custom:selectdic name="userinfo" property="jobtitlecode"
					dictType="JobTitle" disabled="true" />
            </td>
            <td class="td-text" width="106" ><%= label.getLabelName("L_MarriageStatusName") + label.getLabelName("L_Colon") %></td>
            <td width="228" > 
            	&nbsp;<!--<oval:write name="userinfo" property="marriagestatusname"/>-->
              <custom:selectdic name="userinfo" property="marriagestatus"
					dictType="MarriageStatus" 
					disabled="true" />
            </td>
          </tr>
          <tr> 
            <td class="td-text" width="106"><%= label.getLabelName("L_Birthday") + label.getLabelName("L_Colon") %></td>
            <td > 
              	&nbsp;<oval:write name="userinfo" property="birthday"/>
            </td>
            <td class="td-text" width="106"><%= label.getLabelName("L_Begindate") + label.getLabelName("L_Colon") %></td>
            <td width="228" >
              	&nbsp;<oval:write name="userinfo" property="entrydate"/>
            </td>
          </tr>
          <tr> 
            <td class="td-text" width="106"><%= label.getLabelName("L_IDNumber") + label.getLabelName("L_Colon") %></td>
            <td > 
              &nbsp;<oval:write name="userinfo" property="idcardnumber"/>
            </td>
            <td class="td-text" width="106"><%= label.getLabelName("L_PrivateBankAccount") + label.getLabelName("L_Colon") %></td>
            <td width="228" > 
              &nbsp;<oval:write name="userinfo" property="privatebankaccount"/>
           </td>
          </tr>
          <tr> 
            <td class="td-text" width="106"><%= label.getLabelName("L_StatusName") + label.getLabelName("L_Colon") %></td>
            <td >
                &nbsp;<oval:write name="userinfo" property="statusname"/>
            </td>
            <td class="td-text" width="106"><%= label.getLabelName("L_Enddate") + label.getLabelName("L_Colon") %></td>
            <td width="228" >
              	&nbsp;<oval:write name="userinfo" property="leavedate"/>
            </td>
          </tr>
          <td class="td-text" width="106"><%= label.getLabelName("L_IsUseSystem") + label.getLabelName("L_Colon") %></td>
				<td width="228"><!--  <input type="checkbox" id="isusesystemID"
					class="normalradio" 
					name="isusesystem" value="<%=isusesystem %>">-->
					<custom:checkbox  name="userinfo" disabled="true" property="isusesystem"/></td>
				<td class="td-text" width="106"><%= label.getLabelName("L_ParentEmp") + label.getLabelName("L_Colon") %></td>
				<td width="300">
				&nbsp;<oval:write name="userinfo" property="parentusername"/>
				&nbsp;<oval:write name="userinfo" property="parentemployeename"/>
				</td>
			</tr>
			<tr>
				<td class="td-text" width="106"><%= label.getLabelName("L_IsSaleMan") + label.getLabelName("L_Colon") %></td>
				<td width="228">
					<custom:checkbox  name="userinfo" disabled="true" property="issalesman"/>
					 <a
					onclick="javascript:popWindowsContactRelation();"> <custom:button
					type="2" label="L_Asterisk" imgsrc="flash.gif" border="0" /></a> <custom:hidden
					property="issalesman" name="userinfo"></custom:hidden></td>
				<td class="td-text" width="106"><%= label.getLabelName("L_Provicetdr") + label.getLabelName("L_Colon") %></td>
				<td>
				<custom:write property="firstareaname" name="userinfo" />&nbsp;
				<custom:write property="secondareaname" name="userinfo" /> 
				<custom:write property="strareaname" name="userinfo" /> 
				</td>
<tr>
				<td class="td-text" width="106"><%= label.getLabelName("L_Product") + label.getLabelName("L_Colon") %></td>
				<td>
				<a onclick='popWindowsContactProd()'> <custom:button type="2"
					label="L_Asterisk" imgsrc="Time.gif" border="0" /></a></td>
				<td class="td-text" width="106"><%= label.getLabelName("L_Adjustable_Hillock_Time") + label.getLabelName("L_Colon") %></td>
				<td>
					&nbsp;<oval:write name="userinfo" property="adjustdate"/>
					</td>
			</tr>
			<tr>
				<td class="td-text" width="106"><%= label.getLabelName("L_Userqty") + label.getLabelName("L_Colon") %></td>
				<td>
				&nbsp;<custom:write property="userqty" name="userinfo" /> 
				</td>
				<td class="td-text" width="106"><%= label.getLabelName("L_BusinessType") + label.getLabelName("L_Colon") %></td>
				<td>
				<custom:selectdic name="userinfo" property="businesstype"
					dictType="ZylBusinessType" valueCriteria="1,2,3" 
					defaultValue="-------" disabled="true"/></td>
			</tr>
			<tr>
				<td class="td-text" width="106"><%= label.getLabelName("L_Station") + label.getLabelName("L_Colon") %></td>
				<td>&nbsp;<custom:write property="station" name="userinfo"  /></td>
				<td class="td-text" width="106">&nbsp;</td>
				<td>&nbsp;</td>
			</tr>
			</tr>
      </table>
      <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="3" id="passwordtable" style="display: none;">
          <tr>
            <td colspan="4" class="deepblue-left"><img src="../../images/<%= strLanguageCode %>/quote.gif">
              <%= label.getLabelName("L_SystemUserInfo") + label.getLabelName("L_Colon") %></td>
          </tr>
          
          <tr> 
            	<td class="td-text" width="106"><%= label.getLabelName("L_PasswordStartDate") + label.getLabelName("L_Colon") %></td>
            	<td> 
					&nbsp;<oval:write name="userinfo" property="passwordstartdate"/>
            	</td>	
          
            	<td class="td-text" width="106"><%= label.getLabelName("L_PasswordExpireDate") + label.getLabelName("L_Colon") %></td>
            	<td width="228" > 
                 &nbsp;<oval:write name="userinfo" property="passwordexpiredate"/>
            	</td>
           </tr>
          <tr>
          	<td class="td-text" width="106"><%= label.getLabelName("L_PasswordExpireDays") + label.getLabelName("L_Colon") %></td>
            <td> 
              	 &nbsp;<oval:write name="userinfo" property="passwordexpiredays"/>
            </td>
            <td class="td-text" width="106"><%= label.getLabelName("L_CanUpdatePassword") + label.getLabelName("L_Colon") %></td>
            <td width="228" > 
              	 <input type="checkbox" name="passwordflag" class="normalradio" disabled="disabled" <%=JspHelper.filterNull( strIsCanUpdatePassword )%>>
              	 
            </td>
          </tr>
      </table>
      <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="3">
          <tr>
            <td colspan="4" class="deepblue-left"><img src="../../images/<%= strLanguageCode %>/quote.gif">
              <%= label.getLabelName("L_ContactMethod") + label.getLabelName("L_Colon") %></td>
          </tr>
          <tr> 
            <td class="td-text" width="106"><%= label.getLabelName("L_Telephone") + label.getLabelName("L_Colon") %></td>
            <td > 
              &nbsp;<oval:write name="userinfo" property="officephone"/>
            </td>
            <td class="td-text" width="106"><%= label.getLabelName("L_Fax") + label.getLabelName("L_Colon") %></td>
            <td width="228" > 
              &nbsp;<oval:write name="userinfo" property="faxnumber"/>
            </td>
          </tr>
          <tr> 
            <td class="td-text" width="106"><%= label.getLabelName("L_HomePhone") + label.getLabelName("L_Colon") %></td>
            <td > 
              &nbsp;<oval:write name="userinfo" property="homephone"/>
            </td>
            <td class="td-text" width="106"><%= label.getLabelName("L_MobilePhone") + label.getLabelName("L_Colon") %></td>
            <td width="228" > 
              &nbsp;<oval:write name="userinfo" property="mobilephone"/>
            </td>
          </tr>
          <tr> 
            <td class="td-text" width="106">E-mail<%= label.getLabelName("L_Colon") %></td>
            <td > 
              &nbsp;<oval:write name="userinfo" property="email"/>
            </td>
            <td class="td-text" width="106" ><%= label.getLabelName("L_BPNumber") + label.getLabelName("L_Colon") %></td>
            <td  width="228" > 
              &nbsp;<oval:write name="userinfo" property="bpnumber"/>
            </td>
          </tr>
      </table>
      <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="3">
          <tr> 
            <td colspan="4" class="deepblue-left"><img src="../../images/<%= strLanguageCode %>/quote.gif"> 
            <%= label.getLabelName("L_HomeAddress") + label.getLabelName("L_Colon") %></td>
          </tr>
          <tr> 
            <td class="td-text" id="cn" width="106" ><%= label.getLabelName("L_CountryName") + label.getLabelName("L_Colon") %></td>
            <td > 
           		&nbsp;<oval:write name="homeaddress" property="countryname"/>
            </td>
            <td width="106" id="rn" class="td-text"><%= label.getLabelName("L_RegionName") + label.getLabelName("L_Colon") %></td>
            <td width="228"> 
            	&nbsp;<oval:write name="homeaddress" property="regionname"/>
           </td>
          </tr>
          
  
          <tr> 
            <td class="td-text" id="c0" width="104"><%= label.getLabelName("L_CityName") + label.getLabelName("L_Colon") %></td>
            	
				 <td colspan="3"> 
				 	&nbsp;<oval:write name="homeaddress" property="cityname"/>
				 </td>
          </tr>
          <tr> 
            <td width="106" id="zc" class="td-text"><%= label.getLabelName("L_ZipCode") + label.getLabelName("L_Colon") %></td>
            <td colspan="3" >
            	&nbsp;<oval:write name="homeaddress" property="zipcode"/>
            </td>
          </tr>
          <tr> 
            <td class="td-text" id="c1" width="104"><%= label.getLabelName("L_AddressLine1") + label.getLabelName("L_Colon") %></td>
            	
				  <td colspan="3"> &nbsp;<oval:write name="homeaddress" property="addressline1"/>
		     </td>
        </table>
      </td>
  </tr>
  <tr>
    <td class="summary_top"></td>
  </tr>
  <tr> 
    <td height="49" class="td_center"> 
      <a onclick="JavaScript:history.go(-1);"><custom:button type="1" label="L_Back" imgsrc="finish.gif" border="0" style="width:60"/></a>
    </td>
  </tr>
  </form>
</table>
<script>
  showPassword();
</script>

</body>
</html>


